<template>
  <el-table id="select-table" v-bind="$attrs" :data="tableData" style="width: 100%; display: none">
    <el-table-column
      v-bind="$attrs"
      v-for="item in tableColumn"
      :key="item.prop"
      :prop="item.prop"
      :label="item.label"
      :min-width="item.width"
    >
      <template v-slot="{ row }">
        <span>{{ row[item.prop] }}</span>
      </template>
    </el-table-column>
  </el-table>
</template>

<script setup lang="ts">
type TableColumn = {
  prop: string
  label: string
  width: number
  type?: string
}

const props = defineProps({
  tableColumn: { type: Array as () => TableColumn[], required: false },
  tableData: { type: Array, required: false }
})
const emit = defineEmits([])

defineExpose({ props, emit })
</script>
